<% this.title = homework.title + ' - 完成情况' %>
<% include header %>
<% include homework_header %>
<style>
.submit_time {
  font-size: 0.8em;
  margin-top: 5px;
  color: #000;
}
</style>
<div style="overflow-x:auto; margin-top:14px">
  <table class="ui very basic center aligned table">
    <thead>
    <tr>
        <th>用户名</th>
        <% for (let problem of problems) { %>
        <th>
          <a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>">
            <%= syzoj.utils.removeTitleTag(problem.title) %>
          </a>
        </th>
        <% } %>
    </tr>
    </thead>
    <tbody>
      <% for (let item of ranklist) { %>
        <tr>
          <td><a href="<%= syzoj.utils.makeUrl(['user', item[0].id]) %>"><span class="user-name user-<%= syzoj.utils.makeUserColor(item[0].color, item[0].is_admin) %>"><%= item[0].username %></span></a><%- item[0].nickname %><span class="user-nameplate user-gray"><%= item[0].nameplate %></span></td>
          <%
          let i = 1;
          for (let problem of problems) {
          %>
            <td>
              <% if (item[i][0] != null) { %>
                <b>
                  <% if (item[i][0] == 100) { %>
                    <% if (item[i][1] == 1) { %>
                      <i class="check icon score_10"></i>
                    <% } else { %>
                      <span class="score score_10">+<%= item[i][1] - 1 %></span>
                    <% } %>
                  <% } else { %>
                    <span class="score score_<%= parseInt (item[i][0] / 10) %>"><%= item[i][0] %></span>
                  <% } %>
                </b>
              <% } %>
            </td>
          <%
            ++i;
          }
          %>
        </tr>
      <% } %> 
    </tbody>
  </table>
</div>
<% include homework_footer %>
<% include footer %>
